/**
*@description 用户画像》自然人属性》基本信息
*@author yhw
*/
import React, { Component, PropTypes } from 'react';
import { routerRedux } from 'dva/router';
import { connect } from 'dva';
import MainLayout from '../components/MainLayout/MainLayout';
import DataTitle from '../components/DataAssets/DataTitle';
import MatchGrowChart from '../components/DataAssets/MatchGrowChart';
import styles from './BusinessData.less';
import {Card, Icon, Tooltip, Row, Col} from 'antd';


class BusinessData extends Component {
  constructor(props) {
      super(props);
  }
  // 获取数据
  fetchData(type, search){
    this.props.dispatch({
            type: type,
            payload: search
    })
  };
  initData(){
    this.fetchData('BusinessData/busQuery','');
    this.fetchData('BusinessData/matchGrowQuery','');
  };
  componentWillMount() {
    this.initData();
  };

  render(){
  return (
    <MainLayout isShowLeft="showDataSlide">
        <div className={styles.wrap}>
          <DataTitle data={this.props.BusinessData.busData}/>
          <div className={styles.right_con}>
            <MatchGrowChart data={this.props.BusinessData.matchGrowData} loading={this.props.BusinessData.matchGrowLoading}/>
          </div>
        </div>
    </MainLayout>
  );
  }
};

BusinessData.propTypes = {
};

function mapStateToProps({ BusinessData }) {
  return {
    BusinessData: {...BusinessData},
  };
}

export default connect(mapStateToProps)(BusinessData);